<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<%@ page import="zozopo.operations.comm.*" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    
    <title>用户权限管理</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    	
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css" href="<%=basePath %>/css/manual.css">
	<script type='text/javascript' src="<%=basePath %>/jquery/jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<%=basePath%>/comm/js/map.js"></script>
	
  </head>
  
  <body>
  
  <table  width="100%"  border="0" cellpadding="0" cellspacing="0" height="100%">
  	<tr valign="top">
  	
  		<td height="100">
  			 <jsp:include page="/background/head.jsp"></jsp:include>
  		</td>
  	</tr>
  	<tr valign="top">
  		<td>
  		
   
 <form id="modifyuserlimitedForm" name="modifyuserlimitedForm" onSubmit="return true;" action="modifyoperatorlimited_background.action" method="POST" >

  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
  
 <tr>
    	<td width="270" align="center">
    		
    	</td>
    	<td width="100%">

    	</td>
    </tr>
    
    <tr>
    	<td valign="top">
     		<div>
     		
     		</div>
					<s:include value="/background/left.jsp"></s:include>		
     	</td>
     	
     	
     	<td valign="top" >
     	
     	<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		<tr>
     			<td>基本资料</td>
     		</tr>
     	</table>
     	
     	<table align="center">
     		<tr>
     			<td><s:fielderror id="errormessage" /></td>
     		</tr>
     	</table>
     	
   
    	
			<table  border="0" >
				<tr>
				  <td>
				  	<input type="hidden" id="email" name="email" value="<s:property value="email"/> " />
	
					<input type="hidden" id="limitjson" name="limitjson" />
				  	
					  <s:property value="operator.name_operator"/> 
					  <s:property value="operator.email_operator"/>
				  </td>
			  </tr> 
			</table>
	
	
	
	
		
	
	
	<s:iterator id="limitedList" value="limitedList">
 	
  <table border="0" cellpadding="0" cellspacing="0" >
  <s:if test="#limitedList.menulevel_limited==0">
  
		<tr >
		
			<td style= "border:1px solid #ffffff; border-top-color:#6cb1f1;" bgcolor="#e5f3ff" >
			<s:property value="#limitedList.name_limited"/>
			<s:if test="#limitedList.checked==true">
				<input name="<s:property value="#limitedList.code_limited"/>" type="checkbox" value="<s:property value="#limitedList.code_limited"/>"
				 checked="checked"/>
			</s:if>
			<s:else>
					<input name="<s:property value="#limitedList.code_limited"/>" type="checkbox" value="<s:property value="#limitedList.code_limited"/>"/>
			</s:else>  		
			
			
		</td>
  			<td style= "border:1px solid #ffffff; border-top-color:#6cb1f1;" bgcolor="#e5f3ff" >
			<s:property value="#limitedList.code_limited"/>	
			</td>
			
  	</tr>
  	</s:if><s:elseif test="#limitedList.menulevel_limited>=1">
  
  		<tr>
			<td>
			<a href="<%=basePath %><s:property value="#limitedList.url_limited"/>"><s:property value="#limitedList.name_limited"/></a>
			
			<s:if test="#limitedList.checked==true">
				<input name="<s:property value="#limitedList.code_limited"/>" type="checkbox" value="<s:property value="#limitedList.code_limited"/>"
				 checked="checked"/>
			</s:if>
			<s:else>
					<input name="<s:property value="#limitedList.code_limited"/>" type="checkbox" value="<s:property value="#limitedList.code_limited"/>"/>
			</s:else>
  			</td>
  			<td>
  				<s:property value="#limitedList.code_limited"/>
  			</td>

  	</tr>

  		</s:elseif>
  		<s:else>
  			<tr>
		
			<td>
			<s:property value="#limitedList.name_limited"/>
			<s:if test="#limitedList.checked==true">
				<input name="<s:property value="#limitedList.code_limited"/>" type="checkbox" value="<s:property value="#limitedList.code_limited"/>"
				 checked="checked"/>
			</s:if>
			<s:else>
					<input name="<s:property value="#limitedList.code_limited"/>" type="checkbox" value="<s:property value="#limitedList.code_limited"/>"/>
			</s:else>
			</td>
			<td>
  				<s:property value="#limitedList.code_limited"/>
  			</td>
  			
			
  	</tr>
  		</s:else>
  			
  </table>

		</s:iterator>
		<input type="button" value="修改用户权限" onclick="modifyUserlimited()"/>
	</td>
</tr>

	
</table>
 </form>



</td>
</tr>

<tr valign="bottom">
	<td>
		<jsp:include page="/background/tail.jsp"></jsp:include>
	</td>
</tr> 
</table>
<script type="text/javascript">

function insertUserlimited(userlimitedinfo){
	//alert(userlimitedinfo);
	if(userlimitedinfo != undefined){
		//alert(userlimitedinfo);

		window.location.href='adduserlimited_background.action?email=<s:property value="email"/>&limitedId='+userlimitedinfo;
	}
};

function modifyUserlimited(){
		var limitJSON = "[";
		var i=0;
		var limitedLength = $('input:checked').size();
		$('input:checked').each(function(i){
			 //alert($(this).val());
			 
			 limitJSON += "'" + $(this).val()+"'";
			 if((i+1)!=limitedLength){
				 limitJSON += ",";
			 }
			 i++;
		});
		limitJSON +="]";
		
		$("#limitjson").attr('value',limitJSON);
		
		modifyuserlimitedForm.submit();
}






</script>

  </body>

</html>
